Skip to content

[#330] Replace bonding curve chart with real price history#335

Merged
realproject7 merged 1 commit intomainfrom
task/330-price-history-chart
Mar 18, 2026
Merged

[#330] Replace bonding curve chart with real price history#335
realproject7 merged 1 commit intomainfrom
task/330-price-history-chart

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • PriceChart rewritten to query trade_history table for real price-over-time data
  • SVG line chart: time on X-axis, price on Y-axis, green accent polyline
  • Pulsing marker: current price dot with expanding/fading ring animation (pure SVG <animate>)
  • Empty state: pulsing dot + "No trading activity yet" + current price fallback
  • Downsampling: picks ~50 evenly spaced points for large datasets
  • Heading: "Price Curve" → "Price"
  • Props: removed totalSupplyRaw, updated story detail page

2 files changed. Same terminal/monospace aesthetic preserved.

Fixes #330

Test plan

  • npm run build passes
  • npm run typecheck passes
  • Verify chart renders with trade_history data
  • Verify pulsing animation on last data point
  • Verify empty state when no trades exist
  • Verify time labels on X-axis are readable

- PriceChart now queries trade_history table for actual price data
- SVG line chart with time on X-axis, price on Y-axis
- Current price marked with pulsing ring animation (pure SVG)
- Empty state: pulsing dot + "No trading activity yet" message
- Downsamples to 50 points for large datasets
- Heading changed from "Price Curve" to "Price"
- Removed totalSupplyRaw prop, updated parent page

Fixes #330

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

T2b APPROVE

Clean rewrite, all acceptance criteria met:

  • Queries trade_history by token_address, ordered by block_timestamp
  • SVG pulse animation on last data point (expanding ring + fade) ✅
  • Empty state: pulsing dot + "No trading activity yet" + current price fallback ✅
  • totalSupplyRaw prop removed from interface + both parent usages ✅
  • Heading: "Price Curve" → "Price" ✅
  • Terminal/monospace/green aesthetic preserved ✅
  • Downsampling (~50 points) handles large datasets ✅
  • Y-axis scaling with 10% padding avoids clipping
  • Time labels adapt: HH:MM for <1 day, MMM DD for older
  • Single-point edge case handled via || 1 divisor guard

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE

Summary

This PR correctly replaces the synthetic bonding-curve chart with a real trade_history time-series chart while preserving the existing SVG/terminal aesthetic. The prop cleanup and empty-state fallback are both in scope and coherent.

Findings

  • [low] PriceChart now reads trade_history directly, downsamples for dense histories, and keeps the requested pulsing latest-point marker in pure SVG.
    • File: src/components/PriceChart.tsx:39
    • Suggestion: None.
  • [low] Parent usage was updated consistently to drop the obsolete totalSupplyRaw prop.
    • File: src/app/story/[storylineId]/page.tsx:172
    • Suggestion: None.

Decision

Approve. The chart now uses real historical trade data, the empty state is clean, the heading is Price, and local npm run build plus npm run typecheck both pass.

@realproject7 realproject7 merged commit 421b651 into main Mar 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace bonding curve chart with real price history line chart

2 participants